import { IFeidaoAiBrowserComponent } from '@feidao/web/interfaces';
import get_certifi_type_data from '../atom/get-certifi-type-data';
import render from "@feidao/web/atom/browser/render/render";
import { uuid } from '@feidao/web/atom/core/str/uuid';

import P01 from './P01';

export default async function a006(fd: IFeidaoAiBrowserComponent, ...args: any[]) {
	// 组件初始化
	fd.data.accessory_id = uuid();
	// 获取 证照类型 数据
	const data = await get_certifi_type_data(fd, {});
	if (data.length == 0) {
		render(fd, [{ no: '001', name: '证件类型' }], P01, 'P01', 'replace');
	} else {
		render(fd, data, P01, 'P01', 'replace');
	}
}
